import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    redirect: '/layout/my'
  },
  {
    path: '/layout',
    component: () => import('@/views/layout'),
    children: [
      {
        path: '/layout/home',
        component: () => import('@/views/home')
      },
      {
        path: '/layout/qa',
        component: () => import('@/views/qa')
      },
      {
        path: '/layout/video',
        component: () => import('@/views/video')
      },
      {
        path: '/layout/my',
        component: () => import('@/views/my')
      },
      {
        path: '/layout/search',
        component: () => import('@/views/search')
      }

    ]
  }, {
    path: '/article/:articleId',
    component: () => import('@/components/article'),
    props: true
  },
  // {
  //   path: '/myUser',
  //   component: () => import('@/views/myUser')
  // },
  {

    path: '/login',
    name: 'login',
    component: () => import('@/views/login')
  }
]

const router = new VueRouter({
  routes
})

export default router
